<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>计算商品小计案例</title>
</head>

<body>
  <script>

    // 用户输入数据  price num
    let price = prompt('请你输入商品单间：')
    let num = prompt('请你输入商品数量')
    // 2.处理数据  小计=单价*数量
    let result=price * num
    // 输出数据
    document.write(`小计：${result}`)
  </script>
</body>

</html>